package com.vercon.common.mode.common;

import java.io.Serializable;

public class BaseMode<T> implements Serializable {
    private int errno = -1;//旧接口
    private String errmsg;
    private int code = -1;//新接口
    private T data;

    public boolean isSuccessful() {
        return errno == 0 || code == 0;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getErrno() {
        return errno;
    }

    public void setErrno(int errno) {
        this.errno = errno;
    }

    public String getErrmsg() {
        return errmsg;
    }

    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}